package nil.ed.simulator.request.ui.jfx.bean.qq;

import javafx.beans.property.SimpleStringProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import nil.ed.simulator.request.common.QQItem;
import nil.ed.simulator.request.ui.jfx.component.qq.ExtendConfigTableCallback;
import nil.ed.simulator.request.ui.jfx.ui.table.annotation.TableColumn;
import nil.ed.simulator.request.ui.jfx.ui.table.annotation.TableConfig;

/**
 * @author lidelin.
 */
@Data
@TableConfig(callback = ExtendConfigTableCallback.class)
public class QQRow {

    public static final String COMMON_STATUS_INIT = "未开始";
    public static final String TASK_STATUS_ING = "进行中";
    public static final String TASK_STATUS_FAILED = "失败";
    public static final String TASK_STATUS_SUCCESS = "成功";

    public static final String COOKIE_STATUS_FAILED = "失败";
    public static final String COOKIE_STATUS_SUCCESS = "成功";
    public static final String COOKIE_STATUS_NEED_VC = "需要验证码登录";

    @Getter
    @Setter
    private final QQItem qqItem;

    @TableColumn("QQ号")
    private final SimpleStringProperty qq = new SimpleStringProperty("no Login");

    @TableColumn("任务状态")
    private final SimpleStringProperty taskStatus = new SimpleStringProperty(COMMON_STATUS_INIT);

    @TableColumn("Cookie状态")
    private final SimpleStringProperty cookieStatus = new SimpleStringProperty(COMMON_STATUS_INIT);

    public String getQq() {
        return qq.get();
    }

    public SimpleStringProperty qqProperty() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq.set(qq);
    }

    public String getTaskStatus() {
        return taskStatus.get();
    }

    public SimpleStringProperty taskStatusProperty() {
        return taskStatus;
    }

    public void setTaskStatus(String taskStatus) {
        this.taskStatus.set(taskStatus);
    }

    public String getCookieStatus() {
        return cookieStatus.get();
    }

    public SimpleStringProperty cookieStatusProperty() {
        return cookieStatus;
    }

    public void setCookieStatus(String cookieStatus) {
        this.cookieStatus.set(cookieStatus);
    }
}
